<?php
	 
	class Config extends Object {
		
		/**
		* @var $options - an array containing all the options.
		*/
		protected static $options = array();
		
		protected static $option_groups = array();
		
		/**
		* Stores a new option.
		* @param (string)$name - the name of the option.
		* @param (mixed)$option - option value.
		* @return (void)
		*/
		public static function add($name, $option) {
			
			self::$options[$name] = $option;
			
		}
		
		/**
		* Fetches an option with the given name.
		* Throws an exception if the option is not found.
		* @param (string)$name - the name of the option.
		* @return (mixed) $option.
		*/
		public static function fetch($name) {
			
			if(array_key_exists($name, self::$options)) {
				return self::$options[$name];
			}
			
			throw new Exception('Error, there is no option saved under that name');
		}
		
		/**
		* Returns the entire array of options.
		* @param void
		* @return Array.
		*/
		public static function fetchAll() {
			
			return self::$options;
			
		}
		
		/**
		* Dumps all the options.
		* Works only in DEBUG_MODE.
		*/
		public static function dumpAll() {
			
			if(defined('DEBUG_MODE') && DEBUG_MODE) {
				var_dump(self::$options);
			}
		}
		
		public static function loadFromDb($connection = 'default') {
			
		}
		
		protected static function cacheDbSettings() {
		
		}
		
		protected static function loadDbSettingsFromCache() {
		
		}
		
		protected static function flushCached() {
		
		}
		
		
		private function __construct() {}
		private function __destruct() {}
		private function __clone() {}
		
	
	}